| BCGControlBar for .NET > How To > Common Questions |
How to
... set application visual theme in designer and at runtime
In designer select CommandBarManager component (created along with the first toolbar or menu bar dropped on the form) and set its VisualStyle property.
At runtime you can either set the same property (for standard visual themes), or call directly
VisualManager.SetDefaultVisualManager (VisualManager^ manager), where manager refers to a class derived from BCGSoft.Visualization.VisualManager.
In MDI interface use VisualStyle.Inherit enumerated value to tell the child form using parent's visual style.
... enable MDITabs
For full MDITabs support you must derive your forms from BCGSoft.Forms.MdiChildForm.
Subscribe to LoadForm event and call:
LayoutController.GetInstance().EnableMDITabs(this, true);The rest is handled by the library.
.. customize MDITabs appearance
Drop MdiTabsOptions component on the for, set its ParentForm property to the form's name and adjust properties you need.
... add a new MDI form, display this form in MDTabs and set an image for tab
Add a new form to your project. Edit sources deriving the form from BCGSoft.Forms.MdiChildForm.
Assume we want to open a file, display its content in EditFileForm and add "lock" image at the right side of the tab if the file is read-only.
Working with MDI Tabs Copy Code
MDIClientAreamdi = (MDIClientArea)LayoutController.GetInstance().GetMdiClient(this); EditFileForm editForm = new EditFileForm(); editForm.MdiParent = this; editForm.Text = displayName; editForm.Visible = true; TabItem tabItem = mdi.ActiveTabItem; if (tabItem != null && fileIsReadOnly) { tabItem.CloneImages = false; tabItem.ImageRight = m_lockedItemImageList.Images[0]; }
m_lockedImageList is an image list containing the "lock" image. Because tab item copies images by default and we may have a lot similar images set to tabbed documents, it's recommended to set CloneImages property to false.
... save and load state (layout)
Designer generates code required to load and save state in comments. Just locate and uncomment calls on SaveCommonLayout and LoadCommonLayout
Note. Currently LoadCommonLayout loads exactly what was saved. It means, that any changes you've done in development won't be seen. We're working on this problem, but meanwhile we would recommend to enable this option just before production.
... reset layout to the one built in designer
Just call the DockManager.ApplyLayout () method.
... use advanced ToolTip control
Add ToolTipEx component to the form. All controls will have extended properties located in BCGSoft Tooltip category. You can set an image, description and parameters specific to individual control. Along with that you have to set tooltip text as for regular ToolTip component. If you wish to customize tooltip appearance for various controls, you should add ToolTipParams component and assign it to the relevant property. See ToolTipDemo sample for more info.